package com.angel.activity;

import com.umeng.analytics.MobclickAgent;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;

public class WelcomeActivity extends Activity {
	
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		 MobclickAgent.onError(this);//自动捕获异常退出（FC ）

		setContentView(R.layout.welcome);
		Log.i("WelcomeActivity","WelcomeActivity-->onCreate");
		
		new Handler().postDelayed(new Runnable() {// 新建�?��handler实现演示跳转

					public void run() {

						Intent i = new Intent();

						i.setClass(WelcomeActivity.this, LoginActivity.class);

						startActivity(i);

//						finish();

					}
				}, 3000);

	}
	protected void onStart(){
       	super.onStart();
       	Log.i("WelcomeActivity","WelcomeActivity-->onStart");
       	Intent intent=getIntent();
       	int i=intent.getIntExtra("flag", 0);
       	if(i==QuitProgress.EXIT_PROGRESS){//退出程序
       		finish();
       		System.exit(0);
       	}else if(i==QuitProgress.CHANGE_PROGRESS){//切换账号
       		finish();
       	}
   }
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		 MobclickAgent.onResume(this);
	}
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		 MobclickAgent.onPause(this);
	}

}
